package edu.yuhf.datedemo;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalTime;

public class NewDateOperation {
    public void buildDate(){
        LocalDate date = LocalDate.now();
        LocalTime time = LocalTime.of(13,49,10);
        System.out.println(date+" "+time);
        System.out.println("今天是："+date.getMonthValue()+"的第"+"天,星期"+date.getDayOfWeek());
        int year=date.getYear();
        int month=date.getMonthValue();		//date.getMonth()	返回Month对象
        int day=date.getDayOfMonth();
        DayOfWeek dow=date.getDayOfWeek();
        int len=date.lengthOfMonth();
        boolean leap=date.isLeapYear();
        System.out.println(year+"年"+month+"月"+day+"日");
        System.out.println("星期："+dow+",月长度："+len+",是否闫年："+leap);
    }
}
